import request from '@/utils/request'

/***
 * 获取组织架构信息
 */ 
export function getDpartments() {
  return request({
    url: '/company/department'
  })
}

/**
 *  删除部门
 */
export function delDpartments(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

/***
 * 新增部门
 */
export function addDpartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/***
 * 获取部门详情
 */

export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/***
 * 编辑部门
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
